/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/


#if !defined(AFX_PGLCHARMARKER_H__8724F0B3_DD43_4102_8E53_D57FB70215B7__INCLUDED_)
#define AFX_PGLCHARMARKER_H__8724F0B3_DD43_4102_8E53_D57FB70215B7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <pgl/core/PGLMarker.h>

/*! \brief A Text marker

  This marker draws a string. With this class, you can use any character or string as a marker. For example,
  +, - * #, etc... are quite popular...

\par Setting the string

  You can access and modify the string by using the functions SetString and GetString

\par Modifying the font

	You can access the font object by using GetFont .

  \ingroup PGLMarkerGroup
*/
class PGLCORE_EXT_CLASS CPGLCharMarker : public CPGLMarker  
{
PGL_DECLARE_DYNCREATE(CPGLCharMarker);
public:
	//! \name Constructors
	//@{
	//! \name Default constructor
	CPGLCharMarker(const CPGLColor& _color=CPGLColor(), const CPGLColor& _FillColor=CPGLColor(1,1,1,1), double dRadius = 4, bool bFilled = false, LPCTSTR szString = _T("+") );
	//! Copy constructor
	CPGLCharMarker(const CPGLCharMarker& c){*this = c;};
	//! Assignement constructor
	CPGLCharMarker& operator = (const CPGLCharMarker& c);
	virtual ~CPGLCharMarker(){};
	//@}

	//! \name String
	//@{
	//! sets the string as szString
	void SetString( LPCTSTR szString )	{	m_sText = szString;};
	//! sets the string as tChar
	void SetString( TCHAR tChar )		{	m_sText = tChar;};
	//! return string
	LPCTSTR GetString() const			{	return m_sText;};
	//@}

	//! \name Font
	//@{
	//! returns the reference to the font, const
	const CPGLFont& GetFont() const		{	return m_font;};
	//! returns the reference to the font
	CPGLFont& GetFont()					{	return m_font;};
	//@}

	//! \name Radius
	//@{
	//! sets the marker radius
	virtual void SetRadius( double radius );
	//@}

	//! \name Plotting functions
	//@{
	//! Main plotting function
	void PlotGfx(gfxinterface::CGfxInterface& gfx, CPGLDataPtr pDataX, CPGLDataPtr pDataY);
	//! Legend plotting
	void PlotLegendGfx(gfxinterface::CGfxInterface& gfx, float x, float y);
	//@}

	//! \name Serialize functions
	//@{
	//! Serialiation to XML
	void SerializeXML(CPGLArchive& ar);

	//! Debuggin functions
	#ifdef _DEBUG
		//! MFC Dump
	    virtual void Dump( CDumpContext& dc ) const;
		//! MFC AssertValid
	    virtual void AssertValid() const;   
	#endif
	//@}
private:
	//!\name Attributes
	//@{
	//! char
	CString m_sText;
	//! font
	CPGLFont m_font;
	//@}
};


PGL_DECLARE_SMARTPTR( CPGLCharMarker );

#endif // !defined(AFX_PGLCHARMARKER_H__8724F0B3_DD43_4102_8E53_D57FB70215B7__INCLUDED_)
